<?php function renderContentMenuChildren($menu, $view){ ?>
    <li>
        <div style="text-align:right;" class=" <?php
            if ($view->module=='content'
                && $view->controller=='menu'
                && $view->menu_id==$menu['id'] ):
            ?> ui-state-active <?php elseif( ! $menu['active']):
            ?> ui-state-disabled <?php endif;
            ?> ui-corner-all">
            <a style="float:left;" href="<?php
            echo $view->url(array('module' => 'content',
                                      'controller'=>'menu',
                                      'action'=>'admin',
                                      'menu_id'=>$menu['id']),
                    'default', true)
                    ?>">
                    <span class="ui-corner-all ui-widget ui-icon ui-icon-folder-open "></span>
                    <?php echo $menu['title'] ; ?></a>

                <span>&nbsp;</span>
        </div>
        <?php if ($menu->getNode()->hasChildren()): ?>
            <ul>
                <?php foreach ( $menu->getNode()->getChildren() as $child ): ?>
                    <?php renderContentMenuChildren($child, $view); ?>
                <?php endforeach;?>
            </ul>
        <?php endif; ?>
   </li>
<?php } ?>

<ul class="tree"><?php renderContentMenuChildren($this->rootCategory, $this); ?></ul>
